function y = normalmoveout(data, x, dt, vel_t, vel_v)
% y = normalmoveout(data, x, dt, vel_t, vel_v)

tline = (0:size(data, 1)-1)'*dt;
vline = fillvel(vel_t, vel_v, tline);
y = zeros(size(data));
% for traceid = 1:size(data, 2)
%     tau2 = tline.^2 - (x(traceid)./vline).^2;
%     tau = sign(tau2).*sqrt(abs(tau2));
%     y(:, traceid) = interp1(tau, data(:, traceid), tline);
% end

for j = 1:size(y, 2)
    t = sqrt(tline.^2+(x(j)./vline).^2);
    y(:, j) = interp1(tline, data(:, j), t, 'linear');
end
end